﻿@model  HomeCareLibrary.Models.careModel


@if (Model != null)
{

    ViewBag.Title = "Routine";

    ViewBag.Description = Model.task_meta_desc;
    ViewBag.Keywords = Model.task_meta_key;
}
@if (Model != null)
{
    <div class="col-lg-9 col-sm-9 right_part">
        <div class="title clearfix">
            <h1>Home Care Library</h1>
            <div class="head-searchbox">
                <button class="search_go" type="submit"></button>
                <input type="text" class="form-control" id="Search" placeholder="Search">
            </div>

            <div id="accordion" class="panel-group library-accordion">
                <div class="panel panel-default">
                    <div class="panel-heading1">
                        <div id='flyout_menu'>
                            <h4 class="panel-title library ">
                                @Html.Action("menu", "Home")
                            </h4>
                        </div>
                    </div>

                </div>

            </div>
        </div>


        <h3 id="heading1" class="head-tittle">@Model.rc_task_title</h3>
        <div class="media_tab">
            <ul class="nav nav-tabs" id="myTab">
                <li><a class="overview_icon ui-link aOverview" id="aOverview" data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" href="javascript:void(0);"></a></li>
                <li class="active"><a class="routine_icon ui-link aCare" id="aCare" href="javascript:void(0);" data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" data-task="@Model.rc_task_content.Trim().Replace(" ", "-").ToLower()"></a></li>
                <li><a class="q_a_icon ui-link aQuestions" id="aQuestions" href="javascript:void(0)" data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" data-task="@Model.qa_topic.Trim().Replace(" ", "-").ToLower()"></a></li>
                <li><a class="articles_icon ui-link aArticles" id="aArticles"  data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" href="javascript:void(0)"></a></li>
            </ul>
        </div>
        <div class="main-content" id="myTabContent">
            <div class="main-content-inn">
                <div class="content-tab">

                    <div class="tab-content">
                        <div class="routine">

                            <div class="media_rc top-panel">
                                <div class="clearfix">
                                    <div class="pull-left">
                                        <span class="in_title marginTitle">Routine Care Task @if (Model.listRoutine.Count() > 1)
                                                                                             { <span>#</span> } @{ string[] number = Model.task_code.Split('_');
                                                                                                 <span>@number[1]</span>
                                                                                             }</span>

                                        <p class="smells">@Model.rc_task_content</p>
                                        @if (Model.listRoutine.Count() > 0)
                                        {
                                            <div class="topic">
                                                <span class="droptext">There are @(Model.listRoutine.Count())  other topics</span>
                                                <div class="dropdown">
                                                    <a class="btn-small down_arrow" data-toggle="dropdown" href="#"></a>
                                                    <ul aria-labelledby="drop5" role="menu" class="dropdown-menu" id="menu2">
                                                        @foreach (var item in Model.listRoutine)
                                                        {
                                                            <li role="presentation"><a href="@Url.Action("care", "Home", new { id = Model.Feature_name.Trim().Replace(" ", "-").ToLower(), featureID = item.rc_task_content.Trim().Replace(" ", "-") })" tabindex="-1" role="menuitem">@item.rc_task_content</a></li>
                                                        }

                                                    </ul>
                                                </div>
                                            </div>
                                        }
                                    </div>
                                    <div class="imgbox_rc_priority-outer">
                                        <div class="imgbox_rc_priority">
                                            <p class="">Priority</p>
                                            @for (int i = 1; i <= Model.rc_priority; i++)
                                            { 
                                                <img alt="" class="img-responsive" title="" src="@Url.Content("~/images/star-y.png")">
                                               
                                            }
                                            @for (int i = 1; i <= 5 - Model.rc_priority; i++)
                                            { 
                                                <img alt="" class="img-responsive" title="" src="@Url.Content("~/images/star-k.png")">
                                            }
                                        </div>
                                    </div>
                                </div>
                                <p>@Model.task_intro</p>
                                <div class="text-timing">
                                    <p>
                                        <small>Recommended Timing:&nbsp;</small>
                                        @Model.rc_rec_timing
                                        @{string[] month = Model.rc_timing_months.Split(',');
                                          Array.Sort(month);
                                          string months = string.Empty;
                                          for (int i = 0; i < month.Length; i++)
                                          {

                                              switch (Convert.ToInt32(month[i]))
                                              {
                                                  case 1:
                                                      months += "January,";
                                                      break;
                                                  case 2:
                                                      months += "February,";
                                                      break;
                                                  case 3:
                                                      months += "March,";
                                                      break;
                                                  case 4:
                                                      months += "April,";
                                                      break;
                                                  case 5:
                                                      months += "May,";
                                                      break;
                                                  case 6:
                                                      months += "June,";
                                                      break;
                                                  case 7:
                                                      months += "July,";
                                                      break;
                                                  case 8:
                                                      months += "August,";
                                                      break;
                                                  case 9:
                                                      months += "September,";
                                                      break;
                                                  case 10:
                                                      months += "October,";
                                                      break;
                                                  case 11:
                                                      months += "November,";
                                                      break;
                                                  case 12:
                                                      months += "December,";
                                                      break;

                                              }

                                          }

                                            <span>@months.TrimEnd(',')</span>
                                          string time = "";
                                          if (Model.rc_cycle_timing <= 1)
                                          {
                                              time = "(yearly)";
                                          }
                                          else
                                          {
                                              time = "(every " + Model.rc_cycle_timing + " years)";
                                          }
                                            <span>&nbsp;@time</span>
                            
                                        }

                                    </p>
                                </div>
                                <p class="nomargin">
                                    <small>Type: </small>@{
                                          string type = string.Empty;
                                          switch (Model.rc_type)
                                          {
                                              case 1:
                                                  type = "inside";
                                                  break;
                                              case 2:
                                                  type = "outside";
                                                  break;
                                              case 3:
                                                  type = "other";
                                                  break;
                                          }
                                        @type;
                                    }
                                </p>
                            </div>
                            <div class="media_rc">
                                <span class="in_title marginTitle">How To</span>
                                <div class="textWrap">
                                    <p>
                                        <span class="rightimg howto-image">
                                            <img class="img-responsive" alt="@Model.task_howto_image" title="" src="@Model.task_howto_image"></span>
                                        @Model.task_howto
                                    </p>
                                </div>
                                @* place for future google ad text links*@

                                <div class="img_routine">
                                    <span>@{ Html.RenderPartial("google-link-unit-2"); }</span>
                                    @*  <p class="nomargin">blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah</p>*@
                                </div>
                            </div>
                            <div class="media_rc clearfix">
                                <span class="in_title marginTitle">Benefits</span>
                                <div class="right_rc imgbox_rc-benefit">
                                    <div class="imgbox_rc ">
                                        <ul class="list-unstyled icon-banefit">
                                            @{ string[] img = Model.benifits_image.Split(',');
                                               for (int i = 0; i < 4; i++)
                                               {
                                                   string[] text = img[i].Split('/');
                                                   string[] text1 = text[4].Split('.');
                                                <li class="health"><span>
                                                    <img alt="" title="" src="@img[i]"></span><span class="bs"> @text1[0].Replace("_", " ") </span></li>
                                               }
                                                  
                                            }
                                        </ul>
                                    </div>
                                </div>
                                <div class="textWrap">
                                    <p>@Html.Raw(Model.task_benefits_full)</p>
                                </div>

                                <div class="img_routine nomargin">
                                    <span>@{ Html.RenderPartial("google-link-unit-2"); }</span>
                                    <!--  <p class="nomargin">blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah 
                    blah blah blah blah blah blah blah blah blah blah blah blah blah blah</p>-->
                                </div>
                            </div>
                            @if (Model.rc_energy_saving_content != "" && Model.rc_energy_saving_content != null)
                            {
                                <div class="media_rc">
                                    <span class="in_title marginTitle">Energy Savings</span>
                                    <div class="textWrap">
                                        <p>
                                            <span class="rightimg imgbox_rc_stars">
                                                @for (int i = 1; i <= Model.rc_energy_saving_score; i++)
                                                { 
                                                    <img class="img-responsive" src="@Url.Content("~/images/energy_icon.png")" title="" alt="">
                                               
                                                }
                                                @for (int i = 1; i <= 5 - Model.rc_energy_saving_score; i++)
                                                { 
                                                    <img class="img-responsive" src="@Url.Content("~/images/energy-not-s.png")" title="" alt="">
                                               
                                                }
                                            </span>@Model.task_ensav_full
                                        </p>
                                    </div>
                                </div>
                            }
                            <div class="media_rc add_img text-center">
                                @{ Html.RenderPartial("google-ad-unit-wide-2"); }
                            </div>
                            <div class="media_rc">
                                <span class="in_title marginTitle">Costs</span>
                                <div class="textWrap">
                                    <p>
                                        <span class="rightimg imgbox_rc_stars">
                                            @for (int i = 1; i <= Model.rc_cost_score; i++)
                                            { 
                                                <img class="img-responsive" src="@Url.Content("~/images/dollar.png")" title="" alt="">
                                               
                                            }
                                            @for (int i = 1; i <= 5 - Model.rc_cost_score; i++)
                                            { 
                                                <img class="img-responsive" src="@Url.Content("~/images/dollar-not-s.png")" title="" alt="">
                                               
                                            }

                                        </span>@Model.task_costs_full
                                    </p>
                                </div>
                            </div>
                            <div class="media_rc add_img text-center">
                                @{ Html.RenderPartial("google-ad-unit-wide-2"); }
                            </div>


                            <div class="other-task">
                                <span class="in_title marginTitle">Other Tasks</span>
                                <ul class="list-unstyled">
                                    @{
                                   int counter = 2;
                                   foreach (var item in Model.listRoutine)
                                   {  <li><span class="pull-left">Task # @counter:</span> <b>@item.rc_task_content <a href="@Url.Action("care", "Home", new { id = Model.Feature_name.Trim().Replace(" ", "-").ToLower(), featureID = item.rc_task_content.Trim().Replace(" ", "-") })" >
                                       <img src="@Url.Content("~/images/other_right_arrow.png")"></a></b></li>
                                       counter++;
                                   }
                                    }
                                </ul>
                            </div>
                            <div class="visible-phone sponsor_data sponsor_data-btm">
                             
                                 @{ if (Session[HomeCareLibrary.Constants.SessionConstants.PROMO_CODE] != null)
                          {

                              Html.RenderPartial("SponsorDetailMobileView");
                          }
                        }
                            </div>

                            <div class="app-iphone-add text-center visible-phone">
                                <img class="img-responsive" alt="" title="" src="@Url.Content("~/images/free apps mobile version.png")">
                            </div>
                        </div>
                    </div>

                </div>

            </div>
            <div class="bottom_main">
                <h4 id="heading2">@Model.rc_task_title</h4>
                <div class="menu_link"><a data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" href="javascript:void(0);" class="ui-link aOverview">Overview</a>|<a href="javascript:void(0)" data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" data-task="@Model.rc_task_content.Trim().Replace(" ", "-").ToLower()" class="ui-link aCare">Routine Care</a>|<a href="javascript:void(0);" data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" data-task="@Model.qa_topic.Trim().Replace(" ", "-").ToLower()" class="ui-link aQuestions">Q &amp; A</a>|<a data-name="@Model.Feature_name.Trim().Replace(" ", "-").ToLower()" href="javascript:void(0)" class="ui-link aArticles">Articles</a> </div>
            </div>
            <div class="title_btm">
                <h2>Home Care Library</h2>
                <div class="panel-title library ">
                    <a class="accordion-toggle collapsed" href="#">
                        <img src="@Url.Content("~/images/explore-library.png")" class="img-responsive">
                    </a>
                </div>
                <div class="head-searchbox">
                    <button type="submit" class="search_go"></button>
                    <input type="text" placeholder="Search" id="Search" class="form-control">
                </div>
            </div>
        </div>

    </div>
}
<script>
    $(".aOverview").live("click", function () {
        $("#wait").show();
        $("#myTab").show();
        $("#heading1").show();
        var ID = $(this).attr("data-name");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/overview");
        document.title = "Overview";
        jQuery.ajax({
            url: "@Url.Action("overview", "Home")", type: "POST", traditional: true,
            data: { 'id': ID },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".aCare").live("click", function () {
        $("#wait").show();
        var ID = $(this).attr("data-name");
        var task = $(this).attr("data-task");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/care/" + task);
        document.title = "Routine";
        jQuery.ajax({
            url: "@Url.Action("care", "Home")", type: "POST", traditional: true,
            data: { 'id': ID, 'featureID': task },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".care").live("click", function () {
        $("#wait").show();
        var ID = $(this).attr("data-name");
        var task = $(this).attr("data-task");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/care/" + task);
        document.title = "Routine";
        jQuery.ajax({
            url: "@Url.Action("care", "Home")", type: "POST", traditional: true,
            data: { 'id': ID, 'featureID': task },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".aQuestions").live("click", function () {
        $("#wait").show();
        var ID = $(this).attr("data-name");
        var task = $(this).attr("data-task");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/questions/" + task);
        document.title = "Questions";
        jQuery.ajax({
            url: "@Url.Action("questions", "Home")", type: "POST", traditional: true,
            data: { 'id': ID, 'featureID': task },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".questions").live("click", function () {
        $("#wait").show();
        var ID = $(this).attr("data-name");
        var task = $(this).attr("data-task");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/questions/" + task);
        document.title = "Questions";
        jQuery.ajax({
            url: "@Url.Action("questions", "Home")", type: "POST", traditional: true,
            data: { 'id': ID, 'featureID': task },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".aArticles").live("click", function () {
        $("#wait").show();
        var ID = $(this).attr("data-name");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").html(str);
        window.history.pushState("", "Title", "/" + ID + "/articles/");
        document.title = "Articles";
        jQuery.ajax({
            url: "@Url.Action("articles", "Home")", type: "POST", traditional: true,
            data: { 'id': ID },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
            }
        })
    });
    $(".articles").live("click", function () {
        $("#wait").show();
        $("#myTab").hide();
        var ID = $(this).attr("data-name");
        var task = $(this).attr("data-task");
        var str = ID.replace(/\-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) {
            return letter.toUpperCase();
        });
        $("#heading1").hide();
        window.history.pushState("", "Title", "/" + ID + "/articles/" + task);
        document.title = "Articles";
        jQuery.ajax({
            url: "@Url.Action("articles", "Home")", type: "POST", traditional: true,
            data: { 'id': ID, 'featureID': task },
            success: function (data) {
                jQuery('#myTabContent').html('')
                jQuery("#myTabContent").html(data);
                $("#heading2").html(str);
                $("#wait").hide();
                $("#myTab>li:first").addClass('active').siblings().removeClass('active')

            }
        })
    });

</script>
